<div id="results">
    <div class="page_navigation" id="fix_top_pager_nav"></div>
    
    <div class="box clearfix pager_hold" id="pager_hold">
    
        <div class="col">
    
            <label>Sort by</label>
    
            <select name="sort_by" id="sort_by" class="dropdownized">
                <option value="recommended">Recommended</option>
                <? if (!isset($_GET['preview'])): ?>
                        <option value="price">Price</option>
                    <? endif; ?>
                <option value="number_of_stars">Number of stars</option>
                <!--<option value="object_name">Name</option>-->
            </select>
    
        </div>
    
    </div>
    <ul class="list" id="list">
        <?
            if (!isset($_GET['preview'])) {
    
                $build_G = $_GET;
                if ($build_G['dest_hot'] == "")
                    $build_G['dest_hot'] = -1;
    
                unset($build_G['lang']);
    
                $build_GET = http_build_query($build_G);
            }else {
                $build_GET = '&preview=1';
            }
    
    
            $cnt = count($objects);
            for ($i = 0; $i < $cnt; $i++):
    
                $obj_name = URLify::filter($objects[$i]->object_name);
                $href = lang_url('accommodation/' . $obj_name . '-' . $objects[$i]->object_ID . '?' . $build_GET . '&room_id=' . $objects[$i]->rooms[0]->room_ID);
                $thumbnail = HOST_URL_HOTELS . 'gallery/' . $objects[$i]->photo_path . '/thumb_130x130/' . $objects[$i]->photo_name;
                ?>
    
                <li class="js_item" id="box-<?= $objects[$i]->object_ID ?>" data-id="<?= $objects[$i]->object_ID ?>" style="display: block">
    
                    <div class="clearfix holder">
                        <img src="<?= $thumbnail ?>" alt="<?= $objects[$i]->object_name ?>" width="90"> 
    
                        <div class="details">
                            <h2><a href="<?= $href ?>"><?= $objects[$i]->object_name ?></a></h2>
                            <? if (isset($results[$i]->object_x_coordinate) && $results[$i]->object_x_coordinate != "" && isset($results[$i]->object_y_coordinate) && $results[$i]->object_y_coordinate != ""): ?>
                                <a href='javascript:' class="show_map" data-id="<?= $results[$i]->object_ID ?>">Show on map</a>
                            <? endif; ?>
                        </div>
                    </div>
    
    
    
                    <div class="table-holder">
                        <table class="table table-condensed table-hover rooms">
                            <tbody>
                                <tr>
                                    <th><?= lang('res.accommodation'); ?></th>
                                    <th><?= lang('res.service'); ?></th>
                                    <th><?= lang('res.total_price'); ?></th>
                                    <th><?= lang('res.booking'); ?></th>
                                </tr>
                                <?
                                foreach ($results[$i]->rooms as $room):
                                    $href_room = lang_url('accommodation/' . $obj_name . '-' . $results[$i]->object_ID . '?' . $build_GET . '&room_id=' . $room->room_ID);
                                    $person_s = $room->room_max_person > 1 ? lang('res.persons') : lang('res.person');
    
                                    if ($this->lang->mci_current() == 'me'):
    
                                        if ($room->room_max_person == 1)
                                            $person_s = lang('res.person');
                                        else if ($room->room_max_person >= 2 && $room->room_max_person <= 4)
                                            $person_s = lang('res.persone');
                                        else
                                            $person_s = lang('res.persons');
    
                                    endif;
    
                                    /*                        $this->firephp->log('room.'.underscore($room->room_type_name)); */
                                    ?>
                                    <tr>
                                        <td><a href="<?= $href_room ?>"><?= lang('room.' . underscore($room->room_type_name)); ?> <span class="gray"><?= $room->room_description ?></span>&nbsp;<?= lang('form.for'); ?> <?= $room->room_max_person ?> <?= $person_s ?></a></td>
                                        <td class="gray"><?= $room->service_name ?></td>
                                        <td class="price"><? if (!isset($_GET['preview'])) echo $room->selling_total . currency_sign(); ?> </td>
                                        <?
                                        switch ($room->room_selling_type_ID) {
                                            case 1:
                                                ?>
                                                <td class="request">
                                                    <!--<a href="<?= $href_room ?>"></a>-->
                                                    <a class="" href="<?= $href_room ?>"><?= lang('res.send_request'); ?></a>
                                                </td>
                                                <?
                                                break;
    
                                            case 2:
                                                ?><td class="realtime">
                                                    <a class="" href="<?= $href_room ?>"><?= lang('res.book_now'); ?></a>
    
                                                </td><?
                                                break;
                                        };
                                        ?>
    
    
                                    </tr>
                                <? endforeach; ?>
    
                            </tbody>
                        </table>
                </li>
    
                <?
            endfor;
        ?>
    </ul>
    <div class="box clearfix pager_hold">
        <div class="page_navigation clearfix"></div>
    </div>
</div>